package com.dhl.open.imporve;

/**
 * @title: Open
 * @Author danghailiang
 * @Date: 2022/7/25 11:50
 * @Version 1.0
 */
public class OpenImprove {
    public static void main(String[] args) {
        new GraphicEditor().drawShape(new Circle());
        new GraphicEditor().drawShape(new Retangle());
        new GraphicEditor().drawShape(new Pkq());
    }
}

class GraphicEditor {
    public void drawShape(Shape shape) {
        shape.draw();
    }

}

abstract class Shape {
    abstract void draw();
}

class Circle extends Shape {
    @Override
    public void draw() {
        System.out.println("化了圆形");
    }
}

class Retangle extends Shape {
    @Override
    public void draw() {
        System.out.println("化了矩形");
    }
}

class Pkq extends Shape{

    @Override
    void draw() {
        System.out.println("化了皮卡丘");
    }
}


